# 遍历一个文件目录
import os


def findAllFile(path, sp=""):
    filesList = os.listdir(path)

    sp += "   "
    for fileName in filesList:
        # print(fileName)
        fileAbsPath = os.path.join(path, fileName)
        if os.path.isdir(fileAbsPath):
            print(sp + "这是一个目录：" + fileName)
            findAllFile(fileAbsPath, sp)
        else:
            print(sp + "这是一个普通文件：" + fileName)

findAllFile(r"F:\back\python\stu-ptthon-qianfeng")



